import { createWebHashHistory, createRouter } from "vue-router";

import Menu from "./components/Menu.vue";
import Tab2 from "./components/Tab2.vue";
import Tab3 from "./components/Tab3.vue";
const routes = [
  {
    path: "/",
    component: Menu,
    children: [
      {
        path: "/form",
        component: import("./components/AntForm.vue"),
        name: "form",
      },
      { path: "/tab2", component: Tab2, name: "tab2" },
      { path: "/tab3", component: Tab3, name: "tab3" },
      {
        path: "/grid",
        component: import("./components/layout/Grid.vue"),
        name: "单元格（cell）的合并",
      },
      {
        path: "/vxeTable",
        component: import("./components/VxeTableEditable.vue"),
        name: "可自定义编辑的vxe-table",
      },
      {
        path: "/vxegrid",
        component: import("./components/VxeGridEditable.vue"),
        name: "可自定义编辑的vxe-grid",
      },
      {
        path: "/excel",
        component: import("./components/excelExport.vue"),
        name: "excel",
      },
      {
        path: "/datepicker",
        component: import("./components/datePicker.vue"),
        name: "datepicker",
      },
      {
        path: "/gsap",
        component: import("./components/gsap.vue"),
        name: "gsap",
      },
      {
        path: "/formvalidate",
        component: import("./components/elFormValidate.vue"),
        name: "formvalidate",
      },
       {
        path: "/tablevalidate",
        component: import("./components/tableValidate.vue"),
        name: "tablevalidate",
      },
      {
        path: "/test",
        component: import("./components/Test.vue"),
        name: "test",
      },
    ],
    redirect: "/form",
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
export { routes };
